# _*_ coding: UTF-8 _*_
# @Time     : 2021/10/22 10:37
# @Author   : 郑鲁明
# @Site     : http://www.hzdledu.cn/
# @File     : while循环.py
# @Software : PyCharm

# while 循环
# 循环实现1-100的累加
a = 1  # 初始化语句
sum1 = 0
while a <= 100:  # 开启循环的条件，条件为真则开启循环，为假则结束循环
    sum1 = sum1 + a  # 循环体
    a = a + 1  # 迭代语句
    print(sum1)

a = 1
sum1 = 1
while a <= 100:
    sum1 = sum1 * a
    a = a + 1
print(sum1)